package com.cdqidi.core.weixinmanager.domain;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.cdqidi.util.page.BaseQuery;
import com.cdqidi.valid.group.DefaultGroup;
import com.cdqidi.valid.group.DeleteGroup;
import com.cdqidi.valid.group.UpdateGroup;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import java.time.LocalDateTime;

/**
 * 人员和微信用户
 *
 * @author sjk
 */
@EqualsAndHashCode(callSuper = true)
@Data
@Accessors(chain = true)
public class MiddleUserDTO extends BaseQuery {
    @ExcelIgnore
    @JsonIgnore
    private static final String EXCEL_TITLE = "人员和微信用户";
    /**
     * 主键
     */
    @ExcelProperty(value = {EXCEL_TITLE, "主键"})
    @NotBlank(message = "关系ID不能为空", groups = {DeleteGroup.class, UpdateGroup.class})
    @Size(max = 50, message = "关系ID长度不能超过{max}位", groups = {DeleteGroup.class, UpdateGroup.class})
    private String rId;
    /**
     * 用户ID
     */
    @ExcelProperty(value = {EXCEL_TITLE,"用户ID"})
    @NotBlank(message = "用户ID不能为空", groups = DefaultGroup.class)
    @Size(max = 50, message = "用户ID长度不能超过{max}位", groups = DefaultGroup.class)
    private String userId;
    /**
     * 用户手机号
     */
    @ExcelProperty(value = {EXCEL_TITLE,"用户手机号"})
    @NotBlank(message = "用户手机号不能为空", groups = DefaultGroup.class)
    @Size(max = 20, message = "用户手机号长度不能超过{max}位", groups = DefaultGroup.class)
    private String mobile;
    /**
     * 微信unionId
     */
    @ExcelIgnore
    @Size(max = 100, message = "全局唯一编号长度不能超过{max}位", groups = DefaultGroup.class)
    private String unionId;
    /**
     * 用户昵称
     */
    @ExcelProperty(value = {EXCEL_TITLE,"用户昵称"})
    @Size(max = 100, message = "用户昵称长度不能超过{max}位", groups = DefaultGroup.class)
    private String nickName;
    /**
     * 微信用户标识
     */
    @ExcelIgnore
    @Size(max = 100, message = "微信用户标识不能超过{max}位", groups = DefaultGroup.class)
    private String openid;
    /**
     * 绑定时间
     */
    @ExcelProperty(value = {EXCEL_TITLE,"绑定时间"})
    private LocalDateTime bindTime;
    /**
     * 用户头像
     */
    @ExcelIgnore
    @Size(max = 50, message = "用户头像长度不能超过{max}位", groups = DefaultGroup.class)
    private String headImg;
    /**
     * 公众号
     */
    @ExcelIgnore
    @NotBlank(message = "公众号不能为空", groups = DefaultGroup.class)
    @Size(max = 200, message = "公众号长度不能超过{max}位", groups = DefaultGroup.class)
    private String appId;
    /**
     * 公众号显示
     */
    @ExcelIgnore
    private String appIdDisplay;
    /**
     * 备注:员工编号
     */
    @ExcelProperty(value = {EXCEL_TITLE,"备注"})
    private String note;

    @Override
    public void freeData() {
        this.rId = null;
        this.userId = null;
        this.mobile = null;
        this.unionId = null;
        this.nickName = null;
        this.openid = null;
        this.bindTime = null;
        this.headImg = null;
        this.appId = null;
        this.appIdDisplay = null;
        this.note = null;
        super.freeData();
    }
}
